﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/Admin.Master"
    CodeBehind="AdminScheduleSearch.aspx.cs" Inherits="MedicalCare.Admin.AdminScheduleSearch" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="Panel_Search" runat="server" BorderColor="#999966" Direction="LeftToRight"
        GroupingText="搜索条件" Height="207px" Width="300px">
        <table>
            <tr>
                <td width="80px">
                    <asp:Label ID="LblPatient" runat="server" Text="病人"></asp:Label>
                </td>
                <td width="200px">
                    <asp:TextBox ID="TxbPatient" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="LblNurse" runat="server" Text="护工"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TxbNurse" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="LblStartDate" runat="server" Text="起始日期"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TxbBindStarDate" runat="server"></asp:TextBox>
                    <asp:CalendarExtender ID="calendarLoopStartDay" TargetControlID="TxbBindStarDate"
                        runat="server" TodaysDateFormat="yyyy年MM月" DaysModeTitleFormat="yyyy年MM月">
                    </asp:CalendarExtender>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="LblEndDate" runat="server" Text="终止日期"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TxbBindEndDate" runat="server"></asp:TextBox>
                    <asp:CalendarExtender ID="calendarLoopEndDay" TargetControlID="TxbBindEndDate" runat="server"
                        TodaysDateFormat="yyyy年MM月" DaysModeTitleFormat="yyyy年MM月">
                    </asp:CalendarExtender>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="BtnSearch" runat="server" Text="搜索" OnClick="BtnSearchOnClick" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="Search_Result" runat="server" BorderColor="#999966" Direction="LeftToRight"
        GroupingText="搜索结果" Height="207px">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" 
            DataSourceID="ObjectDataSource1" AllowPaging="True" PageSize="5" 
            Width="866px">
            <Columns>
                <asp:TemplateField HeaderText="序号">
                    <ItemTemplate>
                        <asp:Label ID="lblNo" runat="server" Text="Label"></asp:Label>
                    </ItemTemplate>
                     <ItemStyle Wrap="True" />
                     <HeaderStyle Wrap="False" />
                </asp:TemplateField>
                <asp:BoundField DataField="Id" HeaderText="ScheduleID"  Visible="false" SortExpression="Id" />
                <asp:BoundField DataField="NurseId" HeaderText="护工ID" />
                <asp:BoundField DataField="FamilyName" HeaderText="病人姓名" />
                <asp:BoundField DataField="ScheduleDay" HeaderText="安排日程" 
                    DataFormatString="{0:yyyy-MM-dd}" />
                <asp:BoundField DataField="StartDT" HeaderText="开始时间" 
                    DataFormatString="{0:HH:mm:ss }" />
                <asp:BoundField DataField="EndDT" HeaderText="结束时间" 
                    DataFormatString="{0:HH:mm:ss }" />
                <asp:BoundField DataField="Status" HeaderText="状态" />
                <asp:BoundField DataField="Address" HeaderText="地址信息" />
                <asp:BoundField DataField="Details" HeaderText="内容" />
            </Columns>
        </asp:GridView>
        <asp:Label ID="NoResult" runat="server" Visible ="false" Text="暂无结果"></asp:Label>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            SelectMethod="GetSchedule" 
            TypeName="MedicalCare.DbLayer.Adaptors.ScheduleAdaptor">
            <SelectParameters>
                <asp:Parameter Name="orderKey" Type="String"/>
                <asp:Parameter Name="orderVal" Type="String" />
                <asp:Parameter Name="whereStr" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </asp:Panel>
</asp:Content>
